package com.snail.model.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * @author cici
 * @description 评论实体
 * @date 2025/8/19 14:07
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
@Document(indexName = "biz_course_video_comment")
public class CourseVideoComment {
    @Id
    @Field(name = "id", type = FieldType.Long)
    @JsonProperty("id")
    private Long id;

    @Field(name = "user_id", type = FieldType.Long)
    @JsonProperty("user_id")
    private Long userId;

    @Field(name = "course_video_id", type = FieldType.Long)
    @JsonProperty("course_video_id")
    private Long courseVideoId;

    // ✅ 评论内容需要分词搜索
    @Field(name = "content", type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    @JsonProperty("content")
    private String content;

    @Field(name = "create_time", type = FieldType.Date)
    @JsonProperty("create_time")
    private Date createTime;

    @Field(name = "deleted_time", type = FieldType.Date)
    @JsonProperty("deleted_time")
    private Date deletedTime;

}
